<!--
    Desenvolvido pela Fábrica de Software do CESUPA.
    Todos os direitos reservados.

    @author Breno Leite
-->

<ui:component xmlns="http://www.w3.org/1999/xhtml"
              xmlns:ui="http://java.sun.com/jsf/facelets"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:a4j="http://richfaces.org/a4j"
              xmlns:rich="http://richfaces.org/rich"
              xmlns:c="http://java.sun.com/jstl/core"
              xmlns:appcommons="http://www.fabsoft.cesupa.br/appcommons">

    <!-- main content top part -->
    <div id="page-header">
        <table border="0" style="width:100%" cellspacing="1">
            <tr>
                <td id="page-header-title" style="width:68%;">
            <c:if test="${pageicon == null}">
                <div style="background:transparent url(#{facesContext.externalContext.request.contextPath}/infrastructure/images/icons/page-16x16.gif) no-repeat;
                     display:inline-block; padding-left:20px;">
                    <h2>${pagetitle}</h2>
                </div>
            </c:if>

            <c:if test="${pageicon != null}">
                <div style="background:transparent url(${pageicon}) no-repeat;
                     display:inline-block; padding-left:20px;">
                    <h2>${pagetitle}</h2>
                </div>
            </c:if>
            </td>
            <td id="page-controls" style="vertical-align:top;width:auto;">
            <h:form>
                <c:if test="#{showpageinfocontrol == null || showpageinfocontrol == true}">
                    <div id="page-info-control" class="page-title-control">
                        <h:outputLink style="padding-right:1px;vertical-align:middle;"
                                      value="#" title="#{tooltipmessages.PageInformations}"
                                      id="page-informations-link">
                            <h:graphicImage border="0" url="/infrastructure/images/icons/info-16x16.gif"
                                            alt="#{altmessages.PageInfo}"/>
                            <rich:componentControl for="page-info-window"
                                                   attachTo="page-informations-link"
                                                   operation="show" event="onclick"/>
                        </h:outputLink>
                    </div>
                </c:if>
                <ui:define name="additional-page-controls">
                </ui:define>
            </h:form>
            </td>
            </tr>
        </table>
    </div>

    <!-- main content middle part -->
    <c:if test="#{showbreadcrumb == null || showbreadcrumb != 'false'}">
        <h:form>
            <div>
                <div id="breadcrumb">
                    <ul>
                        <li class="first">#{words.YoureAt}:</li>
                        <li class="second">
                        <h:commandLink value="#{words.Home}"
                                       action="SYSTEM.goToLogin"/>
                        </li>
                        <ul>
                            <ui:insert name="breadcrumb">

                            </ui:insert>
                        </ul>
                        <li>${pagetitle}</li>
                    </ul>
                </div>
            </div>
        </h:form>
    </c:if>

    <h:form id="main-form">
        <div style="border:solid 3px #97B7E1;">
            <c:if test="#{showpagecontrols == 'true'}">
                <div id="page-control-area">
                    <ui:insert name="controls">
                        #{texts.NoControls}
                    </ui:insert>
                </div>
            </c:if>

            <!-- main content bottom part -->
            <div id="content">
                <br />
                <!-- main content body -->
                <ui:insert name="content">
                    #{texts.NoContent}
                </ui:insert>
            </div>
        </div>
    </h:form>
</ui:component>